package yangbajing.util.web

import net.liftweb.http.js.{JsMember, JsExp}

trait jQueryBootstrap {
  this: jQueryBase =>

  def collapse(value: JsExp): this.type = {
    _jsExps += jQueryBootstrap.Collapse(value)
    this
  }

  def modal(exp: JsExp): this.type = {
    _jsExps += jQueryBootstrap.Model(exp)
    this
  }
}

object jQueryBootstrap {

  private case class Collapse(key: JsExp) extends JsExp with JsMember {
    def toJsCmd = "collapse(" + key.toJsCmd + ")"
  }

  private case class Model(value: JsExp) extends JsExp with JsMember {
    def toJsCmd = "modal(" + value.toJsCmd + ")"
  }

}
